package com.lcgroup.springdemo.demos.config;

import com.lcgroup.springdemo.demos.interceptor.GlobeInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Component
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource
    private GlobeInterceptor globeInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(globeInterceptor).addPathPatterns("/exception/interceptor");
    }
}
